package com.reagent.response;

/**
 * @Description: 返回状态码定义
 * @ClassNmae: ResultCode
 * @Author: HeYue
 * @DateTime: 2020-11-14 17:41
 * 规定:
 * #200表示成功
 * #1001～1999 区间表示参数错误
 * #2001～2999 区间表示用户错误
 * #3001～3999 区间表示接口异常
 * #后面对什么的操作自己在这里注明就行了
 **/
public enum ResultCode implements CustomizeResultCode {
    SUCCESS(200, "成功"),
    ERROR(400, "失败"),
    TOKEN_EXPIRED(403, "Token令牌过期"),
    TOKEN_SIGNATUREGENERATION(481, "Token签名不一致"),
    TOKEN_ALGORITHMMISMATCH(482, "Token算法不匹配"),
    TOKEN_INVALIDCLAIM(483, "Token有载负荷失效"),
    COMMON_ERROR(999, "未知错误");


    private Integer status;

    private String message;

    ResultCode(Integer status, String message) {
        this.status = status;
        this.message = message;
    }

    @Override
    public Integer getStatus() {
        return status;
    }

    @Override
    public String getMessage() {
        return message;
    }

}
